<template>
  <template v-for="item in config.items">
    <el-button @click="handleClick(item)">{{item.label}}</el-button>
  </template>
  <el-dialog v-model="showDialog" title="弹框">    
    <router-view></router-view>
  </el-dialog>
</template>

<script>
export default {
  props:{
    config:Object
  },
  methods:{
    handleClick(item){
      if(item.action==='dialog'){
        console.log("弹窗",item.url);
        this.$router.push(item.url)
        this.showDialog=true
      }
      else if (item.action==="callapi"){
        console.log("调用api",item.url);
      }
    }
  },
  data(){
    return {
      showDialog:false
    }
  }
}
</script>

<style>

</style>